class Tree
{
    // Return a list containing the inorder traversal of the given tree
    ArrayList<Integer> inOrder(Node root)
    {
     
        Stack<Node> s=new Stack<Node>();
        
        Node curr=root;
        
        ArrayList<Integer> arr=new ArrayList<Integer>();
        
        if(root==null)
        {
            return arr;
        }
        
        while(curr!=null || s.size()>0 )
        {
            while(curr!=null){
                s.push(curr);
                curr=curr.left;
            }
            
            curr=s.pop();
            
            arr.add(curr.data);
            
            curr=curr.right;
            
        }
        
        return arr;
    }
    
    
}